package cn.dataSource.utils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * 测试Druid工具类
 */
public class DruidTest1 {
    private static Connection con = null;
    private static PreparedStatement pst = null;

    /**
     * 完成添加操做
     */
    public static void main(String[] args) {
        try {
            //1,获取连接
            con = JDBCUtils.getConnection();
            //2,定义Sql
            String sql = "insert into student values (3213,'ggg','77','999',null,null,0,1000)";
            //3,获取pst对象
            pst = con.prepareStatement(sql);
            //4,执行sql
            int count = pst.executeUpdate();
            System.out.println(count);
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            JDBCUtils.close(pst,con);
        }
    }
}
